package simple;

import java.util.HashMap;
import java.util.Map;

/**
 * @author 胡宇轩
 * @Email: programboy@163.com
 */
public class FirstLetterToAppearTwice {
    class Solution {
        public char repeatedCharacter(String s) {
            Map<Character, Integer> map = new HashMap<>();
            for (char c : s.toCharArray()) {
                if (map.containsKey(c)) {
                    return c;
                }
                map.put(c, 1);
            }
            return s.charAt(0);
        }
    }
}
